package com.ithei.多线程第二天.并发工具类.countDownLatch;

import java.util.concurrent.CountDownLatch;

public class Demo {
    public static void main(String[] args) throws InterruptedException {
        CountDownLatch countDownLatch = new CountDownLatch(2);
        new Thread(()->{
            try {
                Thread.sleep(1000);
                System.out.println("赵总来了........");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            countDownLatch.countDown();
        }).start();

        new Thread(()->{
            try {
                Thread.sleep(1000);
                System.out.println("张总来了........");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            countDownLatch.countDown();
        }).start();

        countDownLatch.await();
        System.out.println("会议开始...........");


    }
}
